import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86155
 * date: 2024-04-07
 * Time: 20:42
 *
 * @author 数组
 */

public class Test {
    //杨辉三角
    public static void main(String[] args) {
        int[][] arr = new int[10][10];
        for (int i = 0; i < 10; i++) {
            for (int j = 0; j <= i; j++) {
                if (j == 0 || i == j){
                    arr[i][j] = 1;
                }else if(i > 0 && j > 0){
                    arr[i][j] = arr[i-1][j-1] + arr[i-1][j];
                }
            }
            System.out.println();
        }
        for (int i = 0; i < 10; i++) {
            for (int j = 0; j <= i; j++) {
                System.out.print(arr[i][j] + " ");
            }
            System.out.println();
        }

    }
    public static void main1(String[] args) {
        int[][] arr = new int[4][];
        arr[0] = new int[]{1,2,3};
        arr[1] = new int[]{4,5};
        arr[2] = new int[]{6,7,8,9};
        arr[3] = new int[]{10};
        for (int i = 0; i < 4; i++) {
            System.out.println(Arrays.toString(arr[i]));
        }
    }
}
